<!DOCTYPE html>

<html>
<head>
  <script src="../../resources/run-after-layout-and-paint.js"></script>
  <style type="text/css" media="screen">
    body {
        height: 1500px;
        margin: 0;
    }
    
    #box {
        height: 100px;
        width: 100px;
        background-color: blue;
    }
    
    .composited {
        will-change: transform;
    }
   
    iframe {
        display: block;
        margin: 20px;
        height: 200px;
        width: 280px;
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    function doTest()
    {
        if (window.testRunner) {
            runAfterLayoutAndPaint(function() {
              document.getElementById('box').className = 'composited';
              document.getElementById('layers').innerHTML = internals.layerTreeAsText(document);
              testRunner.notifyDone();
            });
        }
    }

    window.addEventListener('load', doTest, false);
  </script>
</head>
<body>
    <div id="box"></div>

    <!-- Tests that when the main document becomes composited, all iframes containing
        any composited content become composited -->
    <iframe src="resources/intermediate-frame.html"></iframe>
    <iframe src="resources/intermediate-frame.html"></iframe>

    <pre id="layers">Layer tree appears here in DRT.</pre>
</body>
</html>
